// 购物车
import http from "@/utils/http";

// 加入购物车
export function  postmembercart(data){
    return http({
        url:'/member/cart',
        method:'post',
        data
    })
}

// 获取购物车列表 /member/cart
export function  getmembercart(){
    return http({
        url:'/member/cart',
        method:'get'
    })
}

// 切换商品选中状态
export function  putmembercart(id,data){
    return http({
        url:`/member/cart/${id}`,
        method:'put',
        data
    })
}

/**
 * 设置全选/取消全选 
 * @param {Boolean} selected 是否选中
 * @param {Array} ids skuId集合
 * @returns 
 */
export function putmembercartselected(selected){
    return http({
        url:'/member/cart/selected',
        method:'put',
        data:{selected}
    })
}

// 删除商品 /member/cart
export function  delmembercart(ids){
    return http({
        url:'/member/cart',
        method:'delete',
        data:{ids}
    })
}